package com.glela.common.model.sms;

import org.apache.commons.lang3.math.NumberUtils;

import com.glela.common.util.DateUtil;

/**
 * 短信模版
 * @author zls
 *
 */
public abstract class SmsTemplate {
	private boolean	sync;		//是否异步，默认异步：true：同步；false:异步
	private String	mobile;		//电话号码
	private String	createTime;	//创建时间

	SmsTemplate() {
		super();
	}

	public SmsTemplate(String mobile) {
		super();
		this.mobile = mobile;
		setCreateTime(DateUtil.getNow());
	}

	public boolean isSync() {
		return sync;
	}

	public void setSync(boolean sync) {
		this.sync = sync;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public boolean checkMsg() {
		if (!NumberUtils.isCreatable(getMobile())) {
			return true;
		}
		return _checkMsg();
	}

	protected abstract boolean _checkMsg();

}
